#ifndef IMAGEHISTOGRAM_H
#define IMAGEHISTOGRAM_H

#include "PixelBuffer.h"

#define HIST_WIDTH 256
#define HIST_HEIGHT 201

class ImageHistogram
{
	PixelBuffer* redBuffer;
	PixelBuffer* greenBuffer;
	PixelBuffer* blueBuffer;
	PixelBuffer* grayBuffer;
	int redCount[HIST_WIDTH];
	int greenCount[HIST_WIDTH];
	int blueCount[HIST_WIDTH];
	int grayCount[HIST_WIDTH];
	double normalizedHistogram[HIST_WIDTH];
    int maxRedCount;
    int maxGreenCount;
    int maxBlueCount;
	int maxGrayCount;
public:
	int* RedHist();
	int* GreenHist();
	int* BlueHist();
	int* GrayHist();
	double* NormalizedHistogram();
    int MinRedValue, MaxRedValue;
    int MinGreenValue, MaxGreenValue;
    int MinBlueValue, MaxBlueValue;
	int MinGrayValue, MaxGrayValue;
	PixelBuffer* RedBuffer();
	PixelBuffer* GreenBuffer();
	PixelBuffer* BlueBuffer();
	PixelBuffer* GrayBuffer();
	void AddPixel(Pixel pixel);
	void Normalize(int wXh);
	void Clear();
	ImageHistogram(void);
	~ImageHistogram(void);
};

#endif